//登录按钮
$("#login").click(function () {
    login();
})


   function login() {
       var uname = $("#username").val();
       var pwd = $("#password").val();
       $(".container-fluid").attr("hidden",false)
       $('#captcha').sliderCaptcha({
           repeatIcon: 'fa fa-redo',
           setSrc: function () {
               return '/school/images/Pic' + 1 + '.jpg';
           },
           onSuccess: function () {
               $.ajax({
                   url: "login",
                   type: "post",
                   data: {"uname":uname,"pwd":pwd},
                   success: function (data1) {
                       if (data1 == "1") {
                           alert("登录成功！");
                           window.location.href = "indexInit";
                       } else if (data1 == "0") {
                           alert("用户名或密码错误！");
                           return true;
                       }
                   }
               })
           }
       });
   }


